/* Questo test serve testare gli algoritmi costruttivi
 * constructiveTest.c
 *
 *  Created on: Jun 26, 2013
 *      Author: koldar
 */

#include <stdio.h>
#include "graph.h"
#include "solution.h"
#include "tabooState.h"
#include "parser.h"
#include "ltm.h"

int main(int argn,const char** args){
	FILE* fgraph;
	Pgraph pgraph;
	Psolution constructivesolution;
	PtabooState ptaboostate;
	int N;
	int K;
	if (argn!=3){
		fprintf(stderr,"numero di parametri errati. Richiesto\n1) il percorso del grafo;\n2)il numero di camion;\n");
		return 0;
	}
	fgraph=fopen(args[1],"r");
	K=atoi(args[2]);
	pgraph=parseGraph(fgraph,&N);
	graphCorrector(pgraph);
	dijkstraFiller(pgraph);
	initSmartWeights(pgraph);
	constructivesolution=initSolution(&K,&N);
	ptaboostate=initTabooState(&N,&K,0);
	printf("sto costruendo la soluzione...\n");
	buildSimpleRandomConstructive(pgraph,constructivesolution,ptaboostate);

	printSolution(stdout,constructivesolution);
	printf("FINE.\n");
}
